<template>
  <div class="navigation-bar">
    <i class="iconfont icon-fanhui" @click="goBack"></i>
    <span class="bar-title">{{ title }}</span>
  </div>
</template>

<script setup lang="ts">
import { defineProps } from 'vue'
import { useRouter } from "vue-router"
const router = useRouter()

defineProps({
  title: { // 导航栏title
    type: String,
    default: ''
  }
})

const goBack = () => {
  router.back()
}
</script>

<style lang="scss" scoped>
.navigation-bar {
  position: relative;
  width: 375px;
  height: 44px;
  display: flex;
  justify-items: center;
  text-align: center;
  z-index: 1;

  .iconfont {
    position: absolute;
    left: 12px;
    top: 9px;
    width: 26px;
    height: 26px;
    padding: 5px;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
  }
}
</style>